package cn.lg.soar.system.auth.entity;

import cn.lg.soar.database.base.entity.BaseEntity;
import cn.lg.soar.database.base.entity.ITenantEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author luguoxiang 469599794@qq.com
 * @Date: 2023/10/28 16:51
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@TableName(value = "lg_sys_data_rule", autoResultMap = true)
@Getter
@Setter
public class DataRule extends BaseEntity implements ITenantEntity {

    private static final long serialVersionUID = 7473536041003906050L;

    @ApiModelProperty(value = "主键id")
    @TableId
    private Long id;

    /**
     * 规则适用接口（0表示适用所有）
     */
    private Long resourceId;

    /**
     * 缺省的，当当前用户未能查到相关规则时使用该规则，一个资源只能有一个缺省规则
     */
    private Boolean defaulted;

    private String name;

    private String remark;

    @ApiModelProperty(value = "租户id")
    @JsonIgnore
    @TableField(select = false)
    private Integer tenantId;

    @Override
    public Serializable primaryKey() {
        return id;
    }

}
